// 微应用模块
import Vue from 'vue'
const microApplication = {
    // 员工数据
    employeeNumber: function employeeNumber(ip, postdata) {
        var ipstr = ip + '?oid=' + postdata.oid + '&access_token=' + postdata.access_token
        return Vue.http.get(ipstr, postdata).then(response => {
            if (response.status == 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 获取微应用列表
    microApplicationList: function microApplicationList(ip, postdata) {
        var ipstr = ip + '/' + postdata.orgId
        return Vue.http.post(ipstr, postdata).then(response => {
            if (response.status == 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 微应用列表编辑排序
    microApplicationListSort: function microApplicationListSort(ip, postdata) {
        var ipstr = ip + '/' + postdata.orgId
        return Vue.http.post(ipstr, postdata).then(response => {
            if (response.status == 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 设置企业应用是否启用
    microApplicationAppIsused: function microApplicationAppIsused(ip, postdata) {
        var ipstr = ip + '/' + postdata.oid
        return Vue.http.post(ipstr, postdata).then(response => {
            if (response.status == 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },

    //    ******************** 审批模块 *************************
    // 审批列表
    approvalList: function approvalList(ip, postdata) {
        var ipstr = ip + '?oid=' + postdata.oid + '&access_token=' + postdata.access_token
        return Vue.http.get(ipstr, postdata).then(response => {
            if (response.status == 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 获取审批设置项
    approvalSetItem: function approvalSetItem(ip, postdata) {
        return Vue.http.post(ip, postdata).then(response => {
            if (response.status == 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 保存审批设置项
    approvalsaveSetItem: function approvalsaveSetItem(ip, postdata) {
        return Vue.http.post(ip, postdata).then(response => {
            if (response.status == 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 设置审批流程
    approvalupdateProcess: function approvalupdateProcess(ip, postdata) {
        return Vue.http.post(ip, postdata).then(response => {
            if (response.status == 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 清空审批流程
    approvaldeleteProcess: function approvaldeleteProcess(ip, postdata) {
        return Vue.http.post(ip, postdata).then(response => {
            if (response.status == 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 获取审批条件
    approvalcdnget: function approvalcdnget(ip, postdata) {
        return Vue.http.post(ip, postdata).then(response => {
            if (response.status == 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 保存审批条件
    approvalcdnsave: function approvalcdnsave(ip, postdata) {
        return Vue.http.post(ip, postdata).then(response => {
            if (response.status == 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 删除审批条件
    approvalcdndelete: function approvalcdndelete(ip, postdata) {
        return Vue.http.post(ip, postdata).then(response => {
            if (response.status == 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 获取抄送人
    approvalcopyget: function approvalcopyget(ip, postdata) {
        return Vue.http.post(ip, postdata).then(response => {
            if (response.status == 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 保存抄送人
    approvalcopysave: function approvalcopysave(ip, postdata) {
        return Vue.http.post(ip, postdata).then(response => {
            if (response.status == 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 获取人员及头像列表
    deptGetOrgTreeAndUser: function deptGetOrgTreeAndUser(ip, postdata) {
        return Vue.http.post(ip, postdata).then(response => {
            if (response.status == 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 获取审批数据列表
    approvalDataList:function approvalDataList(ip, postdata) {
        return Vue.http.post(ip, postdata).then(response => {
            if (response.status == 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 删除审批数据
    approvalDataDelete:function approvalDataDelete(ip, postdata) {
        return Vue.http.post(ip, postdata).then(response => {
            if (response.status == 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },    
    // 获取审批数据导出记录
    approvalDatalog:function approvalDatalog(ip, postdata) {
        return Vue.http.post(ip, postdata).then(response => {
            if (response.status == 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 设置审批模型是否禁用
    approvalIsDisabled:function approvalIsDisabled(ip, postdata) {
        return Vue.http.post(ip, postdata).then(response => {
            if (response.status == 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 获取审批模型
    approvalModelGet:function approvalModelGet(ip, postdata) {
        return Vue.http.post(ip, postdata).then(response => {
            if (response.status == 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },    
    // 保存审批模型
    approvalModelSave:function approvalModelSave(ip, postdata) {
        return Vue.http.post(ip, postdata).then(response => {
            if (response.status == 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },     
    //    **************************** 资讯模块 ******************************
    // 获取侧导航栏目
    columnGet: function columnGet(ip, postdata) {
        return Vue.http.post(ip, postdata).then(response => {
            if (response.status == 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 获取所有内容列表
    contentGet: function contentGet(ip, postdata) {
        return Vue.http.post(ip, postdata).then(response => {
            if (response.status == 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 删除内容
    contentDelete: function contentDelete(ip, postdata) {
        return Vue.http.post(ip, postdata).then(response => {
            if (response.status == 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 设为轮播
    contentUpdate: function contentUpdate(ip, postdata) {
        return Vue.http.post(ip, postdata).then(response => {
            if (response.status == 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 获取内容详情
    contentdetail: function contentdetail(ip, postdata) {
        return Vue.http.post(ip, postdata).then(response => {
            if (response.status == 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 保存/编辑内容
    contentedit: function contentedit(ip, postdata) {
        return Vue.http.post(ip, postdata).then(response => {
            if (response.status == 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // **************************** 公告模块 ******************************
    // 发送公告接口
    noticeapinoticenoticesave: function noticeapinoticenoticesave(ip, postdata) {
        return Vue.http.post(ip, postdata).then(response => {
            if (response.status == 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 获取公告列表
    noticeapinoticenoticelist: function noticeapinoticenoticelist(ip, postdata) {
        return Vue.http.post(ip, postdata).then(response => {
            if (response.status == 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 获取公告详情接口
    noticeapinoticenoticeinfo: function noticeapinoticenoticeinfo(ip, postdata) {
        return Vue.http.post(ip, postdata).then(response => {
            if (response.status == 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // *******************************签到模块**********************************
    // 获取签到信息列表
    signGet: function signGet(ip, postdata) {
        return Vue.http.post(ip, postdata).then(response => {
            if (response.status == 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },    
    // 获取签到详情
    signDetail: function signDetail(ip, postdata) {
        return Vue.http.post(ip, postdata).then(response => {
            if (response.status == 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },    
    // 签到信息数据导出
    signExport: function signExport(ip, postdata) {
        return Vue.http.post(ip, postdata).then(response => {
            if (response.status == 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    
    
    // ***********************日志模块*************************
    // 获取日志信息列表
    logDataGet: function logDataGet(ip, postdata) {
        return Vue.http.post(ip, postdata).then(response => {
            if (response.status == 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    }, 
    // 删除日志信息
    logDataDelete: function logDataDelete(ip, postdata) {
        return Vue.http.post(ip, postdata).then(response => {
            if (response.status == 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
}
export default microApplication
// module.exports = companyset